
















Memorandum to:  Dbase Community

From:           Standards Committee
Date:           
Subject:        Draft Syntax 

This  is  the  Draft 2 syntax,  as compiled so  far.   It  sticks 
closely  to Ashton-Tate's dBASE III Plus as implemented,  not  as 
documented.  

Items not resolved in committee are noted with a `?' on the left.  
Of course,  we solicit your comments and suggestions on the whole 
standard, not merely those items.

Please forward your comments to Sharon Davidson at this office.



.pa















Note:  the committee formally requested Ashton-Tate's comments on 
the  use  of  the  term "Standard  Dbase"  to  name  the  generic 
language.

Ashton-Tate  withdrew  its  observer from the  committee  and  is 
referring all calls on this subject to its legal department.   In 
an  informal discussion with the committee chairman,  an  Ashton-
Tate attorney expressed serious concern over the committee's work 
infringing  on Ashton-Tate's proprietary rights to its dBASE  (r) 
trademark.   A formal letter raising these concerns was promised.  
To date, however, that letter has not been received.

We  presume  that  Ashton-Tate will oppose the use  of  "Standard 
Dbase."

.pa


Contents:

1       Purpose

3       Interactive and non-interactive implementations

4       Syntax of this specification

5       Miscellaneous

6       Character set

7       Components of statements

7         Keywords

12        Constants

13        Fields and memory variables

14        Functions

16        Expressions

18        Other components

23      Statements

24        Simple statements

32        Block statements

33        Program statements

34      Programs





.pa
Standard Dbase




Purpose:


During  1978  and  1979 Wayne  Ratliff  implemented  JPLDIS  (Jet 
Propulsion  Laboratories  Display  and  Information  System),   a 
mainframe fourth generation data processing language, on an IMSAI 
8080,  an  early,  8  bit  microcomputer.   He  called  this  new 
implementation Vulcan.   In 1980,  Wayne entered into a marketing 
agreement with Ashton-Tate, a new software publishing firm.

Ashton-Tate  renamed  the product dBASE II and marketed  it  with 
extraordinary success.  The Dbase language has been extended with 
each new release of Ashton-Tate's product.  While the language is 
only  one component of the product,  it is still a key component.  
To date, Ashton-Tate has sold over 1.5 million dBASE products.

Dbase  became a de facto standard programming language  for  data 
processing applications on microcomputers.   Other companies have 
created  and  successfully marketed implementations of the  Dbase 
language.   Today's  Dbase programmer can choose from a range  of 
excellent compilers and interpreters.   Additionally,  the  Dbase 
programmer  has  access to the broadest range of tools,  such  as 
editors and code generators,  available in any fourth  generation 
language.

The  proliferation of Dbase language implementations has led to a 
number  of  inconsistencies between different vendors'  products.  
These  are sometimes extensions to the  language,  and  sometimes 
minor  variations in syntax.   We wish to strongly encourage  the 
former and eliminate the latter.

To  that end,  we have created the attached specification of 1987 
Standard   Dbase   for  both  interactive   and   non-interactive 
implementations  of the language.   This is one part of  a  total 
process.

Other  key  parts  include  a list of  current  extensions  being 
considered  for inclusion in the language and a list  of  current 
modifications  proposed in the standard.   Additionally,  we have 
created  the  <committee>  to continue to  accept  proposals  for 
extensions  and  modifications,  disseminate these  proposals  as 
widely  as possible and,  with as much public input as  possible, 
make changes to the Standard Dbase specification.

We  trust that the benefits of a dynamic standard will  encourage 
even  more  widespread  use  of  the  Dbase  language  for   data 
processing applications on microcomputers.  Additionally, we hope 
to  encourage vendors to make Standard Dbase available on  larger 
computers,  providing,  over time, a single language running from 
the largest to the smallest computer.

We  wish to encourage vendors to extend the language.   We expect 
that  the nature of the proposed addition will  sometimes  permit 
vendors  to  propose a change prior to the release of a  product, 
and,  in  other  instances,  concurrently with the release  of  a 
product.  We strongly urge all vendors to adhere to the syntax in 
the proposals for extensions when they implement features already 
included in this list.

Finally,  we  encourage vendors to re-publish the Standard  Dbase 
specification  with their documentation,  noting any  differences 
and extensions.




.pa

Interactive and non-interactive implementations

The   language  may  be  implemented  for  interactive  or   non-
interactive use.   In interactive implementations,  a prompt mode 
is available which allows the user to enter all simple statements 
for  immediate  execution.   Additionally,  screen  displays  may 
convey  additional  infomation,  in a manner  determined  by  the 
vendor.

Certain   commands   are   only  relevant   in   an   interactive 
implementation.   These  are  noted.   Use of these  commands  in 
systems   which   may  later  be  run  under  a   non-interactive 
implementation may produce erroneous results.

While   it   has  been  traditional  to   implement   interactive 
interpreters and non-interactive compilers,  this need not be the 
case.     Both   interactive   compilers   and    non-interactive 
interpreters may be implemented.

Occasional  differences  between interactive and  non-interactive 
implementations  are noted and should be avoided  by  programmers 
who require portability.

Implementation of the interactive commands,  such as BROWSE,  are 
vendor  specific.   A  program which includes  these  interactive 
statements will provide the functional capability described,  but 
it  should be assumed that all implementations will be different.  


.pa
Syntax of this specification:

  a | b -- either a or b

  [a]   -- null or a

  [a]... -- 0 or more a's (vendor defined maximums)

  [a]..n -- 0 through n a's

  <a> -- substitute an instance of a (mandatory)

  { } -- grouping, e.g. ` { a [b] } | c ' is ` a | ab | c '

   d  -- digit (0-9)

   l  -- letter (one of A through Z or a through z)

   c  -- any character (as permitted by the system -- see Character Set)

   UPPERCASE -- include as is (in either upper or lowercase)


.pa

Miscellaneous:

The  language is not sensitive to upper or lowercase,  except  in 
character  strings.    For  instance,   all  the  following   are 
equivalent:

        DO WHILE
        do while
        Do While

Tabs  and  spaces may be used freely between  language  elements.  
Blank lines may be used freely for clarity.

All  keywords  may be abbreviated to as few as  four  characters.  
Characters following the fourth are,  however,  significant.  The 
APPEND statement may be:

        APPEND
        APPEN
        APPE

On the other hand, APPENDING is not equivalent.

Keywords  are not reserved.   If there is a field named `append', 
for instance:

        APPEND BLANK
        REPLACE append WITH newvalue

is  syntactically  correct.    Again,  the  capitalization  is  a 
convention not required by the syntax.

Clauses  beginning  with keywords have been  specified  in  their 
conventional order.   However,  they may be written in any order.  
The following are equivalent:

        LIST NEXT 20 FOR state = "CA" FIELDS name,zip
        LIST NEXT 20 FIELDS name,zip FOR state = "CA"
        LIST FOR state = "CA" NEXT 20 FIELDS name,zip
        LIST FOR state = "CA" FIELDS name,zip NEXT 20
        LIST FIELDS name,zip NEXT 20 FOR state = "CA"
        LIST FIELDS name,zip FOR state = "CA" NEXT 20

.pa

Character set:

All  characters  permitted by the hardware system  is  available.  
The following characters are part of the language syntax and must 
have their ASCII byte values:


        Letters A-Z and a-z
        digits 0-9
        + - * / ( ) ' " & @ # $ ^ = [ ] , ; < > ? ! _
        carriage return, line feed, space, tab

A return ( <r> ) is:

        CHR(13) | CHR(10) | {CHR13)CHR(10)}

A positive integer ( <n> ) is:

        d[d]...

where at least one d is non-zero.


.pa

Components of statements:

Keywords:

A  keyword  is one of the following,  delimited by at  least  one 
space, tab, <r>, beginning or end of file.

        ?
        ??
        @
        *
        !
        /A
        /C
        /D
        ACCEPT
        ADDITIVE
        ALIAS
        ALL
        ALTERNATE
        AMERICAN
        ANSI
        APPEND
        ASSIST
        AVERAGE
        BEFORE
        BELL
        BLANK
        BOTTOM
        BRITISH
        BROWSE
        CALL
        CANCEL
        CARRY
        CASE
        CATALOG
        CENTURY
        CHANGE
        CLEAR
        COLOR
        COMMAND
        CONFIRM
        CONSOLE
        CONTINUE
        COPY
        COUNT
        CREATE
        DATABASES
        DATE
        DEBUG
        DECIMALS
        DEFAULT
        DELETE
        DELETED
        DELIMITED
        DELIMITERS
        DEVICE
        DIR
        DISPLAY
        DO
        DOHISTORY
        DOUBLE
        ECHO
        EDIT
        EJECT
        ELSE
        ENDCASE
        ENDDO
        ENDIF
        ENDTEXT
        ENVIRONMENT
        ERASE
        ERROR
        ESCAPE
        EXACT
        EXCEPT
        EXIT
        EXPORT
        EXTENDED
        FIELDS
        FILE
        FILTER
        FIND
        FIXED
        FROM
        FOR
        FORMAT
        FRENCH
        FUNCTION
        GERMAN
        GET
        GETS
        GO
        GOTO
        HEADING
        HELP
        HISTORY
        IF
        IMPORT
        INDEX
        INSERT
        INTENSITY
        INTO
        ITALIAN
        JOIN
        LABEL
        LAST
        LIKE
        LIST
        LOAD
        LOCATE
        LOOP
        MASTER
        MEMORY
        MEMOWIDTH
        MENUS
        MESSAGE
        MODIFY
        MODULE
        NEXT
        NOEJECT
        NOTE
        OFF
        ON
        ORDER
        OTHERWISE
        PACK
        PARAMETER
        PATH
        PICTURE
        PLAIN
        PRINT
        PRIVATE
        PROCEDURE
        PUBLIC
        QUERY
        QUIT
        RANDOM
        RANGE
        READ
        RECALL
        RECORD
        REINDEX
        RELATION
        RELEASE
        RENAME
        REPLACE
        REPORT
        REST
        RESTORE
        RESUME
        RETRY
        RETURN
        RUN
        SAFETY
        SAVE
        SAY
        SCREEN
        SDF
        SET
        SKIP
        SORT
        STATUS
        STEP
        STORE
        STRUCTURE
        SUM
        SUSPEND
        TALK
        TEXT
        TITLE
        TO
        TOP
        TOTAL
        TYPE
        TYPEAHEAD
        UNIQUE
        UPDATE
        USE
        VIEW
        WAIT
        WHILE
        WITH
        ZAP

.pa
Constants:

Constants have the following forms:

  L -- logical
       .T. | .F.

  N -- numeric
       { { [+|-]d[d]...[.[d]...] } | { [+|-].d[d]... } }[{E|e}[+|-]n[n[n]]]

  C -- character string
        '[c]..254' | "[c]..254" | [[c]..254]
        (in the last case, the outer brackets are read literally, e.g. 
  [string] == "string" )

  U -- unquoted string
        [c]...
        where no c is a space, tab, return or linefeed.

  F -- filename
        as defined by the operating system

.pa
Fields and memory variables:

(`var' is used to imply either,  `field' or `memvar' is used when 
appropriate.)

Types: 
  varD -- Date   
  varL -- Logical
  varN -- Numeric
  varC -- Character string
  fieldM -- Memo field

Memory variable name:

        [M->]l[d|l|_]..10

        delimited with space, tab, <r>, beginning or end of file,
  expression operator or comma.  

The tenth character following the `l' is not significant.

Field name:

        [{A|B|C|D|E|F|G|H|I|J|<alias>}->]l[d|l|_]..10

        delimited with space, tab, <r>, beginning or end of file, 
  expression operator or comma.

The tenth character following the `l' is not significant.


.pa
Functions:

Types: 
  funD -- Date   
  funL -- Logical
  funN -- Numeric
  funC -- Character string
  funS -- Source code

Returns
S       &<memvar> -- the contents of <memvar> are substituted in the source code
N       ABS(<expN>) -- absolute value of expN
N       ASC(<expC>) -- ASCII code for first letter of expC
N       AT(<expC1>,<expC2>) -- location of expC1 within expC2, or 0 
L       BOF() -- .true. if beginning of file
C       CDOW(<expD>) -- day of week as a string ("Tuesday")
C       CHR(<expN>) -- ASCII character (expN must be 0 to 255)
C       CMONTH(<expD>) -- name of month as a string ("July")
N       COL() -- column location of cursor
D       CTOD(<expC>) -- converts expC, in form "mm/dd/yy" to date
D       DATE() -- system date
N       DAY(<expD>) -- day of month
C       DBF() -- name of the database file in use (or null string)
L       DELETED() -- .true. if record is marked for deletion
N       DISKSPACE() -- available diskpace, in bytes
N       DOW(<expD>) -- day of week (Sunday = 1)
C       DTOC(<expD>) -- date to "mm/dd/yy" format string
L       EOF() -- .true. if end of file
N       ERROR() -- error number trapped by ON ERROR condition
N       EXP(<expN>) -- 2.718... to the expN power
C       FIELD(<expN>) -- name of the expNth field in the current DBF (or null)
L       FILE(<expC>) -- .true. if expC names a file
C       FKLABEL(<expN>) -- 
N       FKMAX() -- maximum number of special function keys
L       FOUND() -- .true. if last FIND, SEEK, LOCATE or CONTINUE succeeded.
C       GETENV(<expC>) -- OS's environment variables
varies  IIF(<expL>,<exp1>,<exp2>) -- if expL, exp1, else exp2
N       INKEY() -- gets character from keyboard buffer
N       INT(<expN>) -- truncates to integer ( 12.5 -> 12, -12.5 -> -12 )
L       ISALPHA(<expC>) -- .true. if first character in expC is alphabetic
L       ISCOLOR() -- .true. for color mode, .false. for monochrome
L       ISLOWER(<expC>) -- .true. if first character of expC is lowercase
C       LEFT(<expC>,<expN>) -- leftmost expN characters of expC
N       LEN(<expN>) -- length of string 
N       LOG(<expN>) -- natural logarithm
C       LOWER(<expC>) -- expC in all lowercase
C       LTRIM(<expC>) -- expC without leading blanks
D       LUPDATE() -- date of last update of current DBF
N       MAX(<expN1>,<expN2>) -- greater of expN1 and expN2
C       MESSAGE() -- error message
N       MIN(<expN1>,<expN2>) -- lesser of expN1 and expN2
N       MOD(<expN1>,<expN2>) -- expN1 modulo expN2
N       MONTH(<expD>) -- month
C       NDX(<expN>) -- name of the expNth index (1 through 7) open with
        current DBF
C       OS() -- name of the operating system
N       PCOL() -- current printer column
N       PROW() -- current printer row
N       READKEY() -- the key used to exit from full screen input
N       RECCOUNT() -- number of records in current DBF
N       RECNO() -- current record number
N       RECSIZE() -- size of record, in bytes, in current DBF
C       REPLICATE(<expC>,<expN>) -- repeats expC, expN times
C       RIGHT(<expC>,<expN>) -- rightmost expN characters of expC
N       ROUND(<expN1>,<expN2>) -- expN1 rounded to expN2 decimal places
N       ROW() -- current screen cursor row
C       RTRIM(<expC>) -- same as TRIM
C       SPACE(<expN>) -- string of expN spaces
N       SQRT(<expN>) -- square root of expN
C       STR(<expN1>[,<expN2>[,<expN3]]>) 
        expN1 as string, expN2 long, expN3 decimal places
C       STUFF(<expC1>,<expN1>,<expN2>,<expC2>) 
        stuff expC2 into expC1 at expN1 dropping expN2 characters
C       SUBSTR(<expC>,<expN1>[,<expN2]>) 
        expC from character expN1 for expN2 characters
C       TIME() -- system times in hh:mm:ss format
C       TRANSFORM(<exp>,<pic>) -- exp formatted according to picllll
C       TRIM(<expC>) -- expC without trailing blanks 
C       TYPE(<'expC'|expC>) -- type (C, D, L, N, U=unknown) of 'expC' 
        or expC's contents
C       UPPER(<expC>) -- expC in all uppercase
N       VAL(<expC>) -- the numeric value of expC, or 0 if not numeric
C       VERSION() -- name of current Dbase version
N       YEAR(<expD>) -- year, e.g. 1987



.pa
Expressions:

An expression has one of the following types:

  expD -- Date   
  expL -- Logical
  expN -- Numeric
  expC -- Character string
  expX -- date or numeric or character string (eXcept logical)

An expression has the following form:

   [ {+|-|.NOT.} ] { { <constant> | <var> | <fun> | <expression> } 
   [ <operator> <expression> ] }  |  ( <expression> )  

Operators are:

Mathematical and string (in order of precedence):
+, -    unary plus, negation 
**, ^   exponentiation
*, /    multiplication, division
+, -    addition, subtraction, or string contatenation 

Comparison (no precedence):
 <      less than
 <=     less than or equal to
 =      equal to
 >=     greater than or equal to
 >      greater than
 <>, #  not equal to
 $      substring ( a$b returns true if a is a substring in b )

Logical (in order of precedence):
 .NOT.  logical not
 .AND.  logical and
 .OR.   logical or


.pa
Valid expression/operator combinations are:
  .NOT. <expL>
  [+|-] <expN>
  <expN> <mathematical> <expN>
  <expC> {+|-} <expC>
  <expD> <comparison> <expD>
  <expN> <comparison> <expN>
  <expC> <comparison> <expC>
  <expL> { .AND. | .OR. } <expL>
  <expD> - <expD>
  <expD> { + | - } <expN>
  <expN> + <expD>

The  type  of  an  expression may differ from  the  type  of  its 
components, as in:

.NOT. 2 + 2 <> 4

Precedence in evaluation is:
        Within parentheses
        Mathematical and string (as specified)
        Comparison
        Logical (as specified)

Evaluation is left to right if not otherwise specified.


.pa

Other components of statements

Coordinates:

The screen is addressed by character sized rows and columns.  Row 
0, column 0 is the upper left. <coord> is specified by:

        <expN1>,<expN2>

Pictures:

Picture clauses format output and restrict input.  A <pic> is:

        PICTURE { { <functions>[<template>] } | <template> }

  <functions> are one or more symbols from the following list:

        A -- alphabetic characters only
        B -- left justify numberss
        C -- display CR after positive numbers
        D -- American date format
        E -- European date format
        R -- literals in the template are not part of the data
        S<n> -- scroll field within n characters
        X -- display DB after negative numbers
        Z -- display all blanks for a zero value
        ! -- capital letters only
        ( -- enclose negative numbers in parentheses

.pa
  A <template> is a string composed of the following:

        A -- letters only
        L -- logical value only
        N -- letters or digits
        X -- any character
        Y -- Y, y, N or n only, with conversion to uppercase
        9 -- digits only (leading sign allowed in numbers)
        ! -- as X plus convert lowercase to uppercase
        # -- digit or sign or blank
        $ -- show `$' for leading zeros.
        * -- show `*' for leading zeros.
        , -- comma (suppressed on left)
        . -- decimal point
        x -- all other characters are constants 

Lists:

A list of x's, e.g. field list, has the following form:

        <x> [,x]...


Filename:

A <filename> is:

An  unquoted character string recognized by the operating  system 
as naming a logical file.


Alias:

An <alias> is:

        <filename> | {var name}


File specification:

A <file spec> is:

An  unquoted character string recognized by the operating  system 
as specifying a group of files.


Skeletons:

A  <skeleton>  is  an  unquoted  character  string  used  by  the 
operating system as part of a <file spec>.   For instance:  a?b*, 
in DOS.


OS commands:

An  <OS command> is an unquoted character string which is a valid 
command to the operating system.


Storage areas:

A <storage area> is:

An  unquoted  string naming a logical or physical area  for  data 
storage, as defined by the operating system.  For instance, C: or 
\path\ in DOS.


OS devices:

An <OS device> is:

An  unquoted  string naming a logical  or  physical  input/output 
device, as defined by the operating system.


Procedure name:

A <procedure name> is:

        <filename> | <var name>


Date type:

A <date type> is:

  AMERICAN | ANSI | BRITISH | FRENCH | GERMAN | ITALIAN 


Filetype:

A <type> is an unquoted string from a vendor defined list.


Type clause:

A <type clause> is:

  { TYPE <type> } | { SDF [ DELIMITED [ WITH {SPACE|c} ] ] }


Scopes:

A  scope clause controls the range of operation of some commands.  
A <scope> is:

        ALL | { NEXT <n> } | { RECORD <expN> } | REST


Condition clause:

A condition clause is:

{ WHILE <expL> [ FOR <expL> ] } | { FOR <expL> [ WHILE <expL> ] }


Scope & condition:

A <scope & condition> is one, two or all of:

        <scope>
        WHILE <expL>
        FOR <expL>


Get clause:

A <get> is:

        { GET <var> [<pic>] } |
        { GET <varN> [<pic>] [RANGE <expN1,expN2>] } |
        { GET <varD> [<pic>] [RANGE <expD1,expD2>] }


Comments:

A comment is any character string.  Comments are ignored.

.pa
Statements:

A <statement> is:

         { c[c]..253 <r> } | { c[c]..251 && [comment] <r> }

in one of the following forms.

If  the  statement  is  a  comment  (*  or  NOTE)  the  remaining 
characters are ignored.

? Note:   This gives `*' precedence over `;'.  Continuing a comment 
requires a new `*' -- unlike Ashton-Tate's implementation.

If the last non-whitespace character is a `;' the `;', whitespace 
and return are ignored.  (The statement continues on the next line.)

Characters following `&&' are ignored (available for comments).

All statements,  except the alternate form of STORE, start with a 
keyword.

A  <statement  name> is the keyword which begins  the  statement.  
Both:
        STORE <exp> TO <memvar> and
        <memvar> = <exp>
are considered as a STORE statement.

A <statement> is:

        <simple statement> | <block statement> | <program statement>




.pa

A <simple statement> is one of the following:


? <exp list>  
Output CR/LF and the value of the expressions.


?? <exp list> 
Output the value of the expressions.  


@ <coord> CLEAR TO <coord>


@ <coord> <get>


@ <coord> SAY <exp> [<pic>] [ <get> ]


@ <coord> TO <coord> [DOUBLE]


ACCEPT [<expC>] TO <memvar>


APPEND 
interactive


APPEND BLANK


APPEND FROM <filename> [<scope>] [<type clause>]


ASSIST <command list>
interactive


AVERAGE <exp list> [<scope & condition>] [TO <memvar list>]


BROWSE 
interactive


CALL <filename> [ WITH { <expC> | <memvar> } ]
interactive


CANCEL
interactive differs from non-interactive 


CHANGE [<scope & condition>] [FIELDS <field list>]


CLEAR [ { ALL | FIELDS | GETS | MEMORY | TYPEAHEAD } ] 


CLOSE { ALL | ALTERNATE | DATABASES | FORMAT | INDEX | PROCEDURE }


CONTINUE


COPY FILE <filename> TO <filename>


COPY STRUCTURE TO <filename> [ FIELDS <field list> ]


COPY TO <filename> [ <scope & condition> ] [FIELDS <field list> 
[<type clause>]


COPY TO <filename> STRUCTURE EXTENDED


COUNT [ <scope & condition> ] [ TO <memvar> ]


CREATE <filename>


CREATE <filename> FROM <filename>


CREATE { LABEL | QUERY | REPORT | SCREEN | VIEW } <filename>
CREATE VIEW <filename> FROM ENVIRONMENT
interactive


DELETE [ <scope & condition> ]


DELETE FILE <filename>


DIR <file spec>
interactive


DISPLAY [ <scope & condition> ] [ <exp list> ] [OFF] [TO PRINT]


DISPLAY { { HISTORY [LAST <expN>] } | MEMORY | STATUS | STRUCTURE } 
[TO PRINT]
interactive


DO <procedure name> [20WITH <parameter list> ]


EDIT [ <scope & condition> ] [FIELDS <field list>] 
interactive


EJECT


ERASE <filename>


EXPORT TO <filename> [ TYPE <type> ]


FIND <character string> | <n>


GO[TO] { BOTTOM | TOP | <expN> }


HELP [<keyword>]
interactive


IMPORT FROM <filename> TYPE <type>


INDEX ON <expX> TO <filename> [ UNIQUE ]


? The INPUT statement is omitted


INSERT [BEFORE]
interactive


INSERT BLANK [BEFORE]


JOIN WITH <alias> TO <newfile> FOR <expL> [ FIELDS <field list> ]


LABEL FORM <filename> [<scope & condition>] [NOEJECT] 
[ { { TO PRINT } | { TO FILE <filename> } } ]


LIST [ <scope & condition> ] [ <exp list> ] [OFF] [TO PRINT]


LIST { { HISTORY [ LAST <expN> } | MEMORY } [ TO PRINT ]
interactive


LIST { STATUS | STRUCTURE }
interactive


LOAD <filename>


LOCATE [ <scope & condition> ]


LOOP -- see DO WHILE


MODIFY { STRUCTURE | ENVIRONMENT }
interactive


MODIFY { COMMAND | LABEL | QUERY | REPORT | SCREEN | VIEW } <filename>
interactive


{ NOTE | * } [comment]


ON { ERROR | ESCAPE } <simple statement>


PACK


PRIVATE [ ALL [ { LIKE | EXCEPT } <skeleton> ] ] | [ <memvar list> ]


PUBLIC <memvar list>


QUIT


READ [SAVE]


RECALL [ <scope & condition> ]


REINDEX


RELEASE <memvar list> | { ALL [ { LIKE | EXCEPT } <skeleton> ] } | 
{ MODULE <module name> }


RENAME <filename> TO <filename>


REPLACE [ <scope & condition> ] <field> WITH <exp> [, <field> WITH <exp> ]...  

REPORT FORM <filename> [ <scope & condition> ] [ PLAIN ] [ HEADING <expC> ] 
[ NOEJECT ] [ { { TO PRINT } | { TO FILE <filename> } } ]


RESTORE FROM <filename> [ ADDITIVE ]


RESUME
interactive


RETRY


RETURN [ TO MASTER ]


{ RUN | ! } < OS command >


SAVE TO <filename> [ALL { LIKE | EXCEPT } <skeleton> ]


SET { ALTERNATE | (boldface)BELL | CARRY | (boldface)CATALOG | CENTURY | 
CONFIRM | (boldface)CONSOLE | DEBUG | DELETED | DELIMITERS | DOHISTORY | 
ECHO | (boldface)ESCAPE | EXACT | FIELDS | FIXED | (boldface)HEADING | 
(boldface)HELP | (boldface)HISTORY | (boldface)INTENSITY | (boldface)MENUS | 
PRINT | (boldface)SAFETY | (boldface)STATUS | STEP | (boldface)TALK | 
(boldface)TITLE | UNIQUE } { ON | OFF }


(boldface)Boldface = default is ON.  CARRY, CATALOG, DEBUG, DOHISTORY, ECHO, 
HELP, HISTORY, MENUS, SAFETY, STATUS, STEP, TALK and TITLE are interactive.


SET { ALTERNATE | CATALOG | FORMAT | PROCEDURE | VIEW } TO <filename>
CATALOG is interactive.


SET COLOR TO [ <standard> [, <enhanced> [, <border> ] ] ]


SET DATE <date type>


SET { DECIMALS | MEMOWIDTH | ORDER | TYPEAHEAD } TO <expN>


SET DEFAULT TO <storage area>


SET DELIMITERS TO { <expC> | DEFAULT }


SET DEVICE TO { SCREEN | PRINT }


SET FIELDS TO { <field list> | ALL }


SET FILTER TO [ { FILE <filename> } | <expL> ]
?  Under  the  Ashton-Tate interpreter,  the keyword  TO  may  be 
omitted to turn a filter off.


SET FUNCTION <expC> TO <expC>


SET INDEX TO [ <file list> ]


SET MESSAGE TO <expC>
interactive


SET PATH TO <storage area list>


SET PRINTER TO { <OS device> | <filename> }



SET RELATION TO [ { <expX> | <expN> } INTO <alias> ]


SKIP [ <expN> ]


SORT TO <filename> ON <field> [/A] [/C] [/D] [, <field> [/A] [/C] [/D] ]...


{ STORE <exp> TO <memvar list> } | { <memvar> = <exp> }


SUM [ <scope> ] [ <exp list> ] TO [ <memvar list> ] [ <condition clause> ]


SUSPEND
interactive


TOTAL TO <filename> ON <key> [ <scope & condition> ] [ FIELDS <field list> ] 


TYPE <filename> [ TO PRINT ]


UPDATE ON <expX> FROM <alias> REPLACE <field> WITH <exp> [, <field> WITH 
<exp> ]... [RANDOM]


USE [ <filename> [ INDEX <file list> ] [ ALIAS <alias> ] ]


WAIT [ <expC> ] [ TO <memvar> ]


ZAP



.pa
Block statements:

Block statements are one of the following:

(<statements>, as used below, means any combination of simple and 
block statements.

DO CASE
        CASE <expL>
                <statements>
        [CASE <expL2>
                <statements>]...
        [OTHERWISE [comment]
                <statements>]
ENDCASE [comment]


DO WHILE <expL>
        statements
        [ LOOP
        statements]
        [ EXIT [comment] ]
        [statements]
ENDDO [comment]

LOOP and EXIT lines may appear repeatedly and in any order.


IF <expL>
        <statements>
    [ ELSE 
        <statements> ]
ENDIF [comment]


TEXT
  [c]...
ENDTEXT

The characters here may include <r> characters.


.pa

Program statement:

Program statements are one of the following:

PARAMETER <memvar list>


PROCEDURE <procedure name>


.pa
Programs:

As  used here,  <statements> means any combination of simple  and 
block statements.

{ { beginning of file } | [ <PROCEDURE statement> ] } 
[ <PARAMETER statement> ] 
<statements>

The  program  ends  with  the last  statement  prior  to  another 
PROCEDURE statement, or with the end of the file.

The simple statements CANCEL, RETURN and QUIT may appear anywhere 
in the statements portion of the program.

